package com.rem.hutool.my8Thread;

import cn.hutool.core.thread.ThreadFactoryBuilder;
import cn.hutool.core.thread.ThreadUtil;

/**
 * @author Rem
 * @date 2020-08-25
 */

public class ThreadUtilDemo {

    public static void main(String[] args) {


        //执行线程
        // ThreadUtil.execute(() -> System.err.println("123"));

        //创建一个新线程
        Thread nnnn = ThreadUtil.newThread(new Runnable() {
            @Override
            public void run() {
                System.err.println("aaa");
            }
        }, "nnnn");

        //异步执行线程
        ThreadUtil.execAsync(nnnn);
        //结束线程
        ThreadUtil.interrupt(nnnn, false);

        //创建本地线程
       ThreadFactoryBuilder threadFactoryBuilder = ThreadUtil.createThreadFactoryBuilder();


    }
}
